{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}

{/* Import Js,Csss */}
	<js href="__PUBLIC__/Js/admin/listTable.js"/>
	
	<css href="__PUBLIC__/Css/jquery-ui.css" />
	<js href="__PUBLIC__/Js/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/Js/core/plugins.js"/>
{/* Import Js,Csss */}

<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div>
	<table id="mytab"  border="1" class="t1" width="100%">
	    <tr class="a1">
	      <td width="30px" align="center">
	      	<span>{$Think.lang.selectall}</span>
	      	<input type="checkbox" />
	      </td>
	      <td>{$Think.lang.sort_order}</td>
		  <td align="center">{$Think.lang.username}</td>
	      <td align="center">{$Think.lang.email}</td>
	      <td align="center">{$Think.lang.mobile_phone}</td>
	      <td align="center">{$Think.lang.home_phone}</td>
	      <td align="center">{$Think.lang.integration}</td>
	      <td align="center">{$Think.lang.gender}</td>
	      <td align="center">{$Think.lang.qq_num}</td>
	      <td align="center">{$Think.lang.sina}</td>
	      <td align="center">{$Think.lang.ctime}</td>
	      <td width="150px" align="center">{$Think.lang.action}</td>
	    </tr>		   
	    <volist name="userList" id="user">
	    <tr id="tr_{$user.id}" class="value">
	      <td align="center">
	      	<input type="checkbox" />
	      </td>
	      <td>{$user.id}</td>
	      <td>{$user.name}</td>
	      <td>{$user.mail}</td>
	      <td>{$user.mobile_phone}</td>
	      <td>{$user.home_phone}</td>
	      <td>{$user.integration}</td>
	      <td align="center">
	      	<if condition="$user.gender eq 0">
	      		男
	      	<else/>
	      		女
	      	</if>
	      </td>
	      <td>{$user.qq}</td>
	      <td>{$user.sina}</td>
	      <td align="center">{$user.ctime|date='Y-m-d  h:m:s',###}</td>
	      <td align="center">			
			<div class="action">			       		
	      		<span>	      		
					<a class="del" title="{$lang.delete}" data="{$user.id}" href="javascript:void(0);" ></a>
					<a class="quanxian" title="{$lang.allot_user_access}" href="__URL__/allot_user_privilege?id={$user.id}"></a>
	      		</span>
	       	</div>
		  </td>
	    </tr>	
	    </volist>		   
	</table>		
	<include file="Library:paginator"/>
</div>

<!-- [气泡提示框插件HTML代码] -->
	<include file="Core:QTip"/>
<!-- [气泡提示框插件HTML代码] -->

<div id="loading"class="hide"><!--Qloading:不能删除--></div>

<script type="text/javascript">
	// Initialize Url
	listTable.init('__URL__/ajaxUser');	
	// Delete User
	jQuery(function($) {	
		/* 气泡提示框 */
		$('a[title]').qtip({ 
			style: { name: 'green'/* black,cream,green,dark,light,red,blue */, tip: true },
			position: { adjust: { screen: true } } /* 根据位置自动调整 */
		});
		
		/* 物理删除用户 */
		$('a.del').click(function(){
			var id = $(this).attr('data');
			// Ajax Request
			$.ajax({
				url: '__URL__/ajaxUser',
				dataType: "json",
				type: "post",
				data:{'id':id,'action':'del'},
				beforeSend:function(){
					$('#loading').QLoading({'text':'处理中','status':'open','model':true});
				},
				success:function(msg){				
					if(msg.data == '1'){
						var tr = $("#tr_" + id);
						tr.remove();
						$('#loading').QLoading({'text':msg.info,'status':'close','time':0.5,'img':'happy','model':false});
					}
					else{
						$('#loading').QLoading({'text':msg.info,'status':'close','time':1,'img':'sad','model':false});
					}
				}		
			});
		});
		
	});
</script>

